package com.cu.jiekong.service;

import com.alibaba.fastjson.JSON;
import com.cu.jiekong.constants.BizConstants;
import com.cu.jiekong.frame.CacheManager;
import com.cu.jiekong.frame.model.Ret;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * @author jintian
 * @date 15:32
 */
@Service
public class BaseService {

    @Autowired
    private RestTemplate template;

    @Autowired
    private CacheManager cacheManager;


    protected boolean checkLogin(String sessionId) {
        String session = cacheManager.getValue(BizConstants.LOGIN_SESSION_HEAD + sessionId);
        if (StringUtils.isNotBlank(session)) {
            return true;
        }
        return false;
    }
}
